package com.qfedu.sem.po;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import wo.department.po.Staff;

@Entity
@Table(name = "bug_bug")
public class Bug {
	private static Logger LOG = LogManager.getLogger(Bug.class);

	@Id
	private String id; // id

	@Column(length = 50)
	private String title; // 标题

	@Column(length = 500)
	private String description; // 描述

	@Column(length = 20)
	private String level; // 级别

	@Column(length = 20)
	private String rate; // 频度

	@Column(length = 500)
	private String image; // 截图

	@ManyToOne
	@JoinColumn(name = "committer_id")
	private Staff committer; // 提交人

	@Temporal(TemporalType.TIMESTAMP)
	private Date commitTime; // 提交时间

	@ManyToOne
	@JoinColumn(name = "fixer_id")
	private Staff fixer; // 修复人

	@ManyToOne
	@JoinColumn(name = "tester_id")
	private Staff tester; // 测试人

	@ManyToOne
	@JoinColumn(name = "project_id")
	private Project project; // 项目

	@ManyToOne
	@JoinColumn(name = "version_id")
	private BugVersion version; // 版本

	@Temporal(TemporalType.TIMESTAMP)
	private Date fixTime; // 修复时间

	private Boolean confirmBug; // 确认故障

	private String fixRemark; // 修复说明

	@ManyToOne
	@JoinColumn(name = "fixversion_id")
	private BugVersion fixVersion; // 修复版本

	@Temporal(TemporalType.TIMESTAMP)
	private Date testTime; // 测试时间

	private Boolean isOk; // 验证通过

	private String restRemark; // 验证说明

	@ManyToOne
	@JoinColumn(name = "testversion_id")
	private BugVersion testVersion; // 验证版本

	@OneToMany(mappedBy = "bug")
	private List<BugLog> bugLogs; // 故障版本

	private String currentNode; // 当前节点

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public String getRate() {
		return rate;
	}

	public void setRate(String rate) {
		this.rate = rate;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public Date getCommitTime() {
		return commitTime;
	}

	public void setCommitTime(Date commitTime) {
		this.commitTime = commitTime;
	}

	public Staff getFixer() {
		return fixer;
	}

	public void setFixer(Staff fixer) {
		this.fixer = fixer;
	}

	public Staff getTester() {
		return tester;
	}

	public void setTester(Staff tester) {
		this.tester = tester;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public BugVersion getVersion() {
		return version;
	}

	public void setVersion(BugVersion version) {
		this.version = version;
	}

	public Date getFixTime() {
		return fixTime;
	}

	public void setFixTime(Date fixTime) {
		this.fixTime = fixTime;
	}

	public String getFixRemark() {
		return fixRemark;
	}

	public void setFixRemark(String fixRemark) {
		this.fixRemark = fixRemark;
	}

	public BugVersion getFixVersion() {
		return fixVersion;
	}

	public void setFixVersion(BugVersion fixVersion) {
		this.fixVersion = fixVersion;
	}

	public Date getTestTime() {
		return testTime;
	}

	public void setTestTime(Date testTime) {
		this.testTime = testTime;
	}

	public Boolean getIsOk() {
		return isOk;
	}

	public void setIsOk(Boolean isOk) {
		this.isOk = isOk;
	}

	public String getRestRemark() {
		return restRemark;
	}

	public void setRestRemark(String restRemark) {
		this.restRemark = restRemark;
	}

	public BugVersion getTestVersion() {
		return testVersion;
	}

	public void setTestVersion(BugVersion testVersion) {
		this.testVersion = testVersion;
	}

	public List<BugLog> getBugLogs() {
		return bugLogs;
	}

	public void setBugLogs(List<BugLog> bugLogs) {
		this.bugLogs = bugLogs;
	}

	public String getCurrentNode() {
		return currentNode;
	}

	public void setCurrentNode(String currentNode) {
		this.currentNode = currentNode;
	}

	public Staff getCommitter() {
		return committer;
	}

	public void setCommitter(Staff committer) {
		this.committer = committer;
	}

	public Boolean getConfirmBug() {
		return confirmBug;
	}

	public void setConfirmBug(Boolean confirmBug) {
		this.confirmBug = confirmBug;
	}

}
